package com.eat.controller.user;

import com.eat.result.Result;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user/shop")
@Slf4j
@Api("营业状态相关接口")
public class UserShopController {

    @Autowired
    private RedisTemplate redisTemplate;

    @GetMapping("/status")
    public Result<Integer> getStatus(){

        log.info("获取营业状态");
        Integer shop_status = (Integer) redisTemplate.opsForValue().get("shop_status");
//        redisTemplate.opsForValue().set("code","1234",1, TimeUnit.MILLISECONDS);
        return Result.success(shop_status);
    }


}
